import { ApiProperty } from '@nestjs/swagger';
import { IsString } from 'class-validator';
/* 
  当参数验证不通过 validator时，会自动报400错误
*/
export class CreateCoffeeDto {
  @ApiProperty({ description: '咖啡名称', example: '拿铁' })
  @IsString()
  readonly name: string;

  @ApiProperty({ description: '咖啡品牌', example: '瑞幸' })
  @IsString()
  readonly brand: string;

  @ApiProperty({ description: '咖啡口味', example: ['无糖', '常温'] })
  @IsString({ each: true })
  readonly flavors: string[];
}
